import React, { Component } from 'react';

class SubCounter extends Component {

  constructor(props) {
    super(props);
    this.state = {
      
    }
  }

  
  render() {
    //使用的时候直接回调props中的方法即可~
    const { subCounte } = this.props;

    return ( 
      <div>
        <button onClick={() => subCounte(-1)}>-1</button>
        <button onClick={() => subCounte(-5)}>-5</button>
        <button onClick={() => subCounte(-10)}>-10</button>
      </div>
     );
  }
}
 
export default SubCounter;